package com.zx.tfw.enums;

import java.util.HashMap;
import java.util.Map;

public enum ForumEnum {
	
	f1		(1, "f1"),
	f2		(2, "f2"),
	f3		(3, "f3"),
	f4		(4, "f4"),
	f5		(5, "f5"),
	f6		(6, "f6"),
	f7		(7, "f7"),
	f8		(8, "f8"),
	f9		(9, "f9"),
	f10		(10, "f10");
	
	private int code;
	
	private String name;

	private ForumEnum(int code, String name) {
		this.code = code;
		this.name = name;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	
	private static Map<Integer, ForumEnum> map;
	static {
		map = new HashMap<>();
		ForumEnum[] values = ForumEnum.values();
		for (ForumEnum typeEnum : values) {
			map.put(typeEnum.getCode(), typeEnum);
		}
	}
	
	public static Map<Integer, ForumEnum> asMap(){
		return map;
	}
}
